#ifndef UTILS_CONVERT_HPP
#define UTILS_CONVERT_HPP

/**
 * \file
 * \ingroup utility
 * Some converting methoos.
 */

#include <algorithm>
#include <string>

#include "core/exception.hpp"
#include "core/log.hpp"

#include "toml11/toml.hpp"

namespace cas::convert
{
    /**
     * convert K/M/G Ki/Mi/Gi to number
     * \param [in] str input string
     * \returns number
     */
    uint64_t dataSizeToSizeType(const std::string &str);

    /**
     * convert K/M/G Ki/Mi/Gi to number
     * \param [out] result
     * \param [in] str input string
     * \returns true if success
     */
    template <typename T>
    bool tomlDataSizeToSizeType(T &result, const toml::value &val);
}

#endif /* UTILS_CONVERT_HPP */